MPC5604P's CRC hardware module driver.
More...
Go to the source code of this file.
Data Structures |
| union | CRCConfig_t |
Defines |
|
#define | TRUE (1u) |
|
#define | CLEAR (0u) |
|
#define | BITS_IN_NIBBLE (4u) |
|
#define | BITS_IN_BYTE (8u) |
|
#define | BYTES_IN_16 (2u) |
|
#define | BYTES_IN_32 (4u) |
|
#define | BIT_DEFINITION |
|
#define | BIT0 (1u << 0u) |
|
#define | BIT1 (1u << 1u) |
|
#define | BIT2 (1u << 2u) |
|
#define | BIT3 (1u << 3u) |
|
#define | BIT4 (1u << 4u) |
|
#define | BIT5 (1u << 5u) |
|
#define | BIT6 (1u << 6u) |
|
#define | BIT7 (1u << 7u) |
|
#define | BIT8 (1u << 8u) |
|
#define | BIT9 (1u << 9u) |
|
#define | BIT10 (1u << 10) |
|
#define | BIT11 (1u << 11) |
|
#define | BIT12 (1u << 12) |
|
#define | BIT13 (1u << 13) |
|
#define | BIT14 (1u << 14) |
|
#define | BIT15 (1u << 15) |
|
#define | BIT16 (1u << 16) |
|
#define | BIT17 (1u << 17) |
|
#define | BIT18 (1u << 18) |
|
#define | BIT19 (1u << 19) |
|
#define | BIT20 (1u << 20) |
|
#define | BIT21 (1u << 21) |
|
#define | BIT22 (1u << 22) |
|
#define | BIT23 (1u << 23) |
|
#define | BIT24 (1u << 24) |
|
#define | BIT25 (1u << 25) |
|
#define | BIT26 (1u << 26) |
|
#define | BIT27 (1u << 27) |
|
#define | BIT28 (1u << 28) |
|
#define | BIT29 (1u << 29) |
|
#define | BIT30 (1u << 30) |
|
#define | BIT31 (1u << 31) |
|
#define | CRC_INSTANCE_0 0x00u |
|
#define | CRC_INSTANCE_1 0x01u |
|
#define | CRC_INSTANCE_0_MASK 0x00u |
|
#define | CRC_INSTANCE_1_MASK 0x10u |
|
#define | CRC_CCITT 0x00u |
|
#define | CRC_32 0x04u |
|
#define | CRC_NO_MSB_SWAP 0x00u |
|
#define | CRC_MSB_SWAP 0x02u |
|
#define | CRC_NO_RESULT_INV 0x00u |
|
#define | CRC_RESULT_INV 0x01u |
| #define | CRC_DMA_CH_0 (10u) |
| #define | CRC_DMA_CH_1 (11u) |
|
#define | N_ELEMENTS(X) (sizeof(X)/sizeof(*(X))) |
| #define | CRC32_0(XX, YY, ZZ) |
| #define | CRC32_1(XX, YY, ZZ) |
| #define | CCITT_0(XX, YY, ZZ) |
| #define | CCITT_1(XX, YY, ZZ) |
Enumerations |
| enum | DEFAULT_CRC_CONFIG_INDECES { CRC_0_CCITT = 0,
CRC_1_CCITT,
CRC_0_32,
CRC_1_32
} |
Functions |
| void | vfnInitCRC (uint8_t u8Instance, uint32_t u32Remainder) |
| | Makes sure that a CRC engine is empty and ready for computation.
|
| uint8_t | u8fnCRC (const uint8_t *pu8StartAddress, const uint32_t u32NOfBytes, uint32_t *pu32Result, const uint32_t u32Remainder, const uint8_t u8DMAChannel, const uint8_t u8CRCConfig) |
| | Reinitializes a CRC instance for computation, configures DMA for followed operation, and launches the operation.
|
| void | vfnCRC0Isr (void) |
| | True DMA Isr, it clears the DMA Isr flag and calls common code for all CRC Isrs.
|
| void | vfnCRC1Isr (void) |
| | True DMA Isr, it clears the DMA Isr flag and calls common code for all CRC Isrs.
|
Detailed Description
MPC5604P's CRC hardware module driver.
Copyright (C) 2011 Freescale Semiconductor Freescale Confidential Proprietary
- Author:
- Freescale Semiconductor
-
SASD Automotive
-
r11515
- Version:
- Date:
- Warning:
- (If needed)
History:
Define Documentation
| #define CCITT_0 |
( |
|
XX, |
|
|
|
YY, |
|
|
|
ZZ |
|
) |
| |
| #define CCITT_1 |
( |
|
XX, |
|
|
|
YY, |
|
|
|
ZZ |
|
) |
| |
| #define CRC32_0 |
( |
|
XX, |
|
|
|
YY, |
|
|
|
ZZ |
|
) |
| |
| #define CRC32_1 |
( |
|
XX, |
|
|
|
YY, |
|
|
|
ZZ |
|
) |
| |
| #define CRC_DMA_CH_0 (10u) |
DMA channel for CRC0 HW unit
| #define CRC_DMA_CH_1 (11u) |
DMA channel for CRC1 HW unit
Function Documentation
| uint8_t u8fnCRC |
( |
const uint8_t * |
pu8StartAddress, |
|
|
const uint32_t |
u32NOfBytes, |
|
|
uint32_t * |
pu32Result, |
|
|
const uint32_t |
u32Remainder, |
|
|
const uint8_t |
u8DMAChannel, |
|
|
const uint8_t |
u8CRCConfig |
|
) |
| |
Reinitializes a CRC instance for computation, configures DMA for followed operation, and launches the operation.
- Parameters:
-
| pu32StartAddress,: | Pointer to the first byte that will be computed |
| u32NOfBytes,: | Number of bytes to be included in computation. |
| pu32Result,: | Pointer to location where the result will be stored once the operation is done. |
| u32Remainder,: | Starting value used to compute. Sometimes fixed by the algorithm, as is the case for CRC32 (0xFFFFFFFF). |
| u8DMAChannel,: | DMA channel used for this operation. |
| u8CRCConfig,: | Index of configuration used for the module as listed in DEFAULT_CRC_CONFIG_INDECES with relation to cau8CRCConfigs. |
- Returns:
- CLEAR if everything went according to plan, TRUE if the DMA channel hasn't been serviced (pending computation).
True DMA Isr, it clears the DMA Isr flag and calls common code for all CRC Isrs.
- Returns:
- Void.
True DMA Isr, it clears the DMA Isr flag and calls common code for all CRC Isrs.
- Returns:
- Void.
| void vfnInitCRC |
( |
uint8_t |
u8Instance, |
|
|
uint32_t |
u32Remainder |
|
) |
| |
Makes sure that a CRC engine is empty and ready for computation.
- Parameters:
-
| u8Instance,: | Either 0 or 1 for MPC5604P. |
| u32Remainder,: | Starting value used to compute. Sometimes fixed by the algorithm, as is the case for CRC32 (0xFFFFFFFF). |
- Returns:
- void